hysop.backend.device.opencl.operator.spatial_filtering module

class hysop.backend.device.opencl.operator.spatial_filtering.OpenClPolynomialInterpolationFilter(input_field, output_field, input_topo, output_topo, **kwds)[source]

Bases: PolynomialInterpolationFilterBase, OpenClOperator

apply(**kwds)

Abstract method that should be implemented. Applies this node (operator, computational graph operator…).

discretize()[source]

By default, an operator discretize all its variables. For each input continuous field that is also an output field, input topology may be different from the output topology.

After this call, one can access self.input_discrete_fields and self.output_discrete_fields, which contains input and output dicretised fields mapped by continuous fields.

self.discrete_fields will be a tuple containing all input and output discrete fields.

Discrete tensor fields are built back from discretized scalar fields and are accessible from self.input_tensor_fields, self.output_tensor_fields and self.discrete_tensor_fields like their scalar counterpart.

class hysop.backend.device.opencl.operator.spatial_filtering.OpenClPolynomialRestrictionFilter(input_field, output_field, input_topo, output_topo, **kwds)[source]

Bases: PolynomialRestrictionFilterBase, OpenClOperator

apply(**kwds)

Abstract method that should be implemented. Applies this node (operator, computational graph operator…).

discretize()[source]

By default, an operator discretize all its variables. For each input continuous field that is also an output field, input topology may be different from the output topology.

After this call, one can access self.input_discrete_fields and self.output_discrete_fields, which contains input and output dicretised fields mapped by continuous fields.

self.discrete_fields will be a tuple containing all input and output discrete fields.

Discrete tensor fields are built back from discretized scalar fields and are accessible from self.input_tensor_fields, self.output_tensor_fields and self.discrete_tensor_fields like their scalar counterpart.

class hysop.backend.device.opencl.operator.spatial_filtering.OpenClSpectralRestrictionFilter(plot_input_energy=None, plot_output_energy=None, **kwds)[source]

Bases: SpectralRestrictionFilterBase, OpenClOperator

OpenCL implementation for lowpass spatial filtering: small grid -> coarse grid using the spectral method.

Initialize a SpectralRestrictionFilterBase.

Parameters:
  • plot_input_energy (IOParams, optional, defaults to None) – Plot input field energy in a custom file.

  • plot_output_energy (IOParams, optional, defaults to None) – Plot output field energy in a custom file.

Notes

IOParams filename is formatted before being used:

{fname} is replaced with field name {ite} is replaced with simulation iteration id

If None is passed, no plots are generated.

apply(**kwds)

Abstract method that should be implemented. Applies this node (operator, computational graph operator…).

class hysop.backend.device.opencl.operator.spatial_filtering.OpenClSubgridRestrictionFilter(input_field, output_field, input_topo, output_topo, **kwds)[source]

Bases: SubgridRestrictionFilterBase, OpenClSymbolic

OpenCL implementation for lowpass spatial filtering: small grid -> coarse grid using the subgrid method.

Create an OpenClOperator with extra symbolic kernels.

All input and output variable topologies should be of kind Backend.OPENCL and share the same OpenClEnvironment.

kwds

Base class keyword arguments.

Type:

dict

apply(**kwds)

Abstract method that should be implemented. Applies this node (operator, computational graph operator…).

setup(work)[source]

Setup temporary buffer that have been requested in get_work_properties(). This function may be used to execute post allocation routines. This sets self.ready flag to True. Once this flag is set one may call ComputationalGraphNode.apply() and ComputationalGraphNode.finalize().

Automatically honour temporary field memory requests.